<template>
	<view class="register-list-header" @click="toPage">
		<view class="register-list-header-header flexR">
			<image style="flex-shrink: 0;" src="../../static/images/icon/log.png" mode="scaleToFill"></image>
			<view class="register-list-header-header-right flexC">
				<text style="font-size: 28rpx; color: #000000;font-weight: bold;">{{hospitalInfo.name}}</text>
				<text style="font-size: 22rpx; color: #A5A5A5;">{{hospitalInfo.address}}</text>
				<view class="introduce">
					{{hospitalInfo.describe}}
				</view>
				<!-- <view class="tag">
					<u-tag :text="typeName" 
					 type="success" shape='circle' mode="plain" :color='themeColor' :border-color='themeColor'/>
				</view> -->
			</view>
		</view>
		<!-- <view class="introduce">
			{{hospitalInfo.describe}}
		</view> -->
		<!-- <rich-text :nodes="introductionHtml" class="introduce"></rich-text> -->
	</view>
</template>

<script>
	import { transName, transHtml } from '../../common/js/common.js'
	import { mapGetters } from 'vuex'
	import { getHospitalInfo } from '@/api/login.js'
	import { themeColor } from '@/static/js/theme.js'
	export default {
		dicts:['hospital_type','status'],
		computed:{
			...mapGetters(['hospitalInfo']),
			typeName(){
				if(this.hospitalInfo.type){
					let typeName = transName(this.hospitalInfo.type, this.dict['hospital_type'])
					return typeName
				}else{
					return '医院'
				}
			},
			introductionHtml(){
				if(this.hospitalInfo.introduction){
					return transHtml(this.hospitalInfo.introduction)
				}else{
					return transHtml('暂无介绍')
				}
			}
		},
		data(){
			return {
				// hospitalInfo:{
				// 	// name:'的说法是的发送到水电费',
				// 	// address:"水电费水电费的说法是的发送到",
				// 	// type:'dsdsfdsfsd水电费水电费',
				// 	// introduction:'SDK接口数据福克斯的恢复健sdfsdfd的非官方是的说法是的发送到方式的的股份打个梵蒂冈地方过度梵蒂冈的发鬼地方个地方市场选择从中选出康的书法家肯定是'
				// },
				themeColor
			}
		},
		created(){
			// this.getHospitalInfo()
		},
		methods:{
			getHospitalInfo(){
				getHospitalInfo().then(data => {
					data.introductionHtml = transHtml(data.introduction)
					data.typeName = transName(data.type, this.dict['hospital_type'])
					this.hospitalInfo = data
				})
			},
			toPage(){
				uni.navigateTo({
					url:'/pages/Introduce/hospital'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.register-list-header{
		padding: 30rpx;
		background-color: $uni-bg-color;
		height: 240rpx;
		.register-list-header-header{
			>image{
				height: 150rpx;
				width: 150rpx;
				// margin: 0 26rpx 0 26rpx;
			}
			.register-list-header-header-right{
				>.tag{
					margin-top: 26rpx;
				}
			}
		}
		.introduce{
			margin-top: 28rpx;
			height: 72rpx;
			color: $text-color;
			line-height: 36rpx;
			font-size: 24rpx;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box; // 作为弹性伸缩盒子模型显示。
		    -webkit-box-orient: vertical; // 设置伸缩盒子的子元素排列方式--从上到下垂直排列
		    -webkit-line-clamp: 2; // 显示的行
		}
	}
</style>
